//
//  showImage.swift
//  skincare
//
//  Created by whu125 on 2023/5/25.
//

import Foundation
import SwiftUI

func showImage(urlString:String)-> Image{
    let httpURLString = urlString.replacingOccurrences(of: "http://", with: "https://")
    //将url中https转换为http
    guard let url = URL(string: httpURLString),
          let data = try? Data(contentsOf: url),
          let uiImage = UIImage(data: data)
    else {
        print("Failed to load image from URL: \(urlString)")
        return Image(systemName: "photo")
    }

   // print("Loaded image from URL: \(urlString)")
    return Image(uiImage: uiImage)
}
